
###############################################################################
#  PROJECT_ALL_DIR        - store all directories under the project
#                           used by the find<package>.cmake modules
#  PROJECT_ALL_LIB_DIR    - store all directories under the project
#                           which stores the built libraries
#

# - Try to find library defE

# Once done this will define following variables
#  
#  DEFE_FOUND        - system has defE library
#  DEFE_INCLUDE_DIRS - the defE include directory
#  DEFE_LIBRARIES    - Link these to use defE
#

FIND_PATH( DEFE_INCLUDE_DIR defESphereSystem.h
           /usr/include
           /usr/local/include
           ${DEFE_INSTALL_PATH}/include
           ${DEFE_INSTALL_PATH}/include/defE )

#FIND_LIBRARY( DEFE_SPHERES_LIBRARY
              #NAMES defESpheres
              #PATH /usr/lib
                   #/usr/local/lib
                   #${DEFE_INSTALL_PATH}/lib )
#FIND_LIBRARY( DEFE_GEOMETRY_LIBRARY
              #NAMES defEGeometry
              #PATH /usr/lib
                   #/usr/local/lib
                   #${DEFE_INSTALL_PATH}/lib )
#FIND_LIBRARY( DEFE_SPHERES_CUDAWRAPPER_LIBRARY
              #NAMES defESpheresWrapperCUDA
              #PATH /usr/lib
                   #/usr/local/lib
                   #${DEFE_INSTALL_PATH}/lib )

#SET( DEFE_LIBRARIES ${DEFE_SPHERES_LIBRARY}
                    #${DEFE_SPHERES_CUDAWRAPPER_LIBRARY}
                    #${DEFE_GEOMETRY_LIBRARY} )
SET( DEFE_LIBRARIES
     ${DEFE_INSTALL_PATH}/lib/libdefESpheres.so
     ${DEFE_INSTALL_PATH}/lib/libdefEGeometry.so
     ${DEFE_INSTALL_PATH}/lib/libdefESpheresWrapperCUDA.so )

IF( DEFE_INCLUDE_DIR AND DEFE_LIBRARIES )
    SET( DEFE_FOUND TRUE )
ENDIF( DEFE_INCLUDE_DIR AND DEFE_LIBRARIES )

IF( DEFE_FOUND )
    IF(NOT DEFE_FIND_QUIETLY )
        MESSAGE( STATUS "Found library defE: ${DEFE_LIBRARIES}" )
    ENDIF(NOT DEFE_FIND_QUIETLY )
ELSE( DEFE_FOUND )
    IF( DEFE_FIND_REQUIRED )
        MESSAGE( FATAL_ERROR "Couldn't find defE library" )
    ENDIF( DEFE_FIND_REQUIRED )
ENDIF( DEFE_FOUND )

MESSAGE( STATUS "Found library defE: lib    : ${DEFE_LIBRARIES}" )
MESSAGE( STATUS "Found library defE: include: ${DEFE_INCLUDE_DIR}" )
